package nekomv.server;

/* a neko thread whose singular purpose is to insert world_update events at
   the appropriate intervals, keeping game state locked at the desired 
   framerate. 
   
   If framerate becomes low will race conditions result? We will have two
   threads that both call pmserverinst.update ... a source of race conditions
   and other synchronization nastiness
   
   solution appears to be to have two kinds of updates, stateless updates
   and state-mutable updates. Clients queue up stateless updates and the
   timer update changes the state. */

import general.GameSpeed;

class TimerThread
{

    public static var cont : Bool;
    public static var mvserverinst : MiniverseServer;

    public static function loop()
    {
        cont = true;
        while (cont)
        {
            neko.Sys.sleep(GameSpeed.secondsperframe);
            mvserverinst.mutableupdate();
        }
    }

}